package www.reagnetbox.com.view;

import android.content.Context;

import com.lxj.xpopup.core.CenterPopupView;
import com.lxj.xpopup.util.XPopupUtils;

import www.reagnetbox.com.R;
import www.reagnetbox.com.adapter.RecentStockInListAdapter;
import www.reagnetbox.com.bean.RecentStockInListItem;
import www.reagnetbox.com.callback.SimpleCallback;
import www.reagnetbox.com.util.RecyclerViewUtil;
import www.reagnetbox.com.util.XPopupUtil;

public class StockInPopup extends CenterPopupView {
    Context context;
    SimpleCallback callback;

    public StockInPopup(Context context , SimpleCallback callback) {
        super(context);
        this.context=context;
        this.callback = callback;
    }

    @Override
    protected int getImplLayoutId() {
        return R.layout.popup_stock_in;
    }

    @Override
    protected int getMaxHeight() {
        return (int) (XPopupUtils.getScreenHeight(getContext()) * .75f);
    }


    @Override
    protected int getMaxWidth() {
        return (int) (XPopupUtils.getScreenWidth(getContext()) * .55f);
    }

    @Override
    protected void onCreate() {
        super.onCreate();

//        recentStockInListAdapter = new RecentStockInListAdapter(this,R.layout.item_recent_stock_in_list,recentStockInList);
//        recentStockInListAdapter.setOnItemClickListener((adapter, view, position) -> {
//            RecentStockInListItem data = recentStockInList.get(position);
//            XPopupUtil.showKnowPopup(context,data.getName());
//        });
//        RecyclerViewUtil.initRecyclerView(context, recentStockInListAdapter);





        findViewById(R.id.tv_cancel).setOnClickListener(v -> dismiss());
        findViewById(R.id.tv_ok).setOnClickListener(v -> {
            dismiss();
            callback.fun();
        });
    }
}
